﻿using System.Web.Mvc;

namespace MVC.ApiExplorer.Demo.Areas.AnArea
{
	public class AnAreaAreaRegistration : AreaRegistration
	{
		public override string AreaName
		{
			get
			{
				return "AnArea";
			}
		}

		public override void RegisterArea(AreaRegistrationContext context)
		{
			context.MapRoute(
				"AnArea_InArea",
				"AnArea/api/{action}",
				new { action = "Index", controller = "InArea"},
				new[] { "The.controller.belong.to.an.area" }
			);

			context.MapRoute(
				"AnArea_OutterAPI",
				"AnArea/outer/{action}",
				new { action = "Index", controller = "ExploreOutterAPI" },
				new[] { "The.controller.belong.to.an.area" }
			);

			context.MapRoute(
				"AnArea_default",
				"AnArea/{controller}/{action}/{id}",
				new { action = "Index", id = UrlParameter.Optional },
				new[] {"The.controller.belong.to.an.area"}
			);
		}
	}
}
